/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.colegiatura.bc;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.cip.esymons.colegiatura.be.Sancion;

/**
 *
 * @author ADMINISTRADOR
 */
@Stateless
public class SancionFacade implements SancionFacadeLocal {
    @PersistenceContext
    private EntityManager em;

    public void create(Sancion sancion) {
        em.persist(sancion);
    }

    public void edit(Sancion sancion) {
        em.merge(sancion);
    }

    public void remove(Sancion sancion) {
        Sancion aux = em.merge(sancion);
        em.remove(aux);
    }

    public Sancion find(Object id) {
        return em.find(Sancion.class, id);
    }

    public List<Sancion> findAll() {
        return em.createQuery("select object(o) from Sancion as o").getResultList();
    }

}
